package xyz.maxwells.bigdata.ctrl;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * Created by wuzusheng on 2018/5/15.
 */
//@RestController
//@CrossOrigin
//public class ExcelFileUpload {
//    @RequestMapping("/upload")
//    public void upload(MultipartFile file)throws Exception{
//        if (!file.isEmpty()){
//            String path = "G:\\毕业设计\\bigdata\\src\\main\\resources\\excellfile";
//            System.out.println("上传文件的路径："+path);
//            File filepath = new File(path,file.getOriginalFilename());
//            String filename = file.getOriginalFilename();
//            if(!filepath.getParentFile().exists()){
//                filepath.getParentFile().mkdirs();
//            }
//            file.transferTo(new File(path + File.separator + filename));
//        }
//    }
//}
